package com.zwr.sheller.shop.controller;

import com.zwr.sheller.core.common.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/order")
@Api(tags = "退货订单管理")
public class RefoundController {
    @PostMapping("/selectRefoundOrderByType")
    @ApiOperation("查询各种状态的退货订单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "condition", value = "模糊查询条件", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "refoundOrderStatus", value = "退货订单状态", required = true, dataType = "Integer", paramType = "query"),
            @ApiImplicitParam(name = "createOrderTime", value = "订单创建时间", required = false, dataType = "Timestamp", paramType = "query"),
    })
    public Map<String , Object> selectRefoundOrderByType(String condition , Integer refoundOrderStatus , Timestamp createOrderTime){

        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("1");
        jsonResult.setMsg("查询成功");
        jsonResult.setField("Data","null");
        return  jsonResult.getMap();
    }


    @PostMapping("/selectRefoundOrderDetail")
    @ApiOperation("查询某个退货订单的详细信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderID", value = "订单ID", required = true, dataType = "Integer", paramType = "query"),
    })
    public Map<String , Object> selectRefoundOrderDetail(Integer orderID){
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("1");
        jsonResult.setMsg("查询订单详情成功");
        jsonResult.setField("GoodsDetail","");
        jsonResult.setField("OrderDetail","");
        jsonResult.setField("ReceivingInformation","");
        jsonResult.setField("ReturnApplicationInformation","");
        return  jsonResult.getMap();
    }



    @PostMapping("/updateRefoundOrder")
    @ApiOperation("批量修改退货订单的状态")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderId", value = "订单ID", required = true, dataType = "Integer", paramType = "query"),
            @ApiImplicitParam(name = "refoundStatus", value = "退货订单状态", required = true, dataType = "Integer", paramType = "query"),

    })
    public   Map<String , Object> updateRefoundOrder(List<Integer> orderId,Integer refoundStatus){
        //循环修改
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("1");
        jsonResult.setMsg("修改退货订单成功");

        return  jsonResult.getMap();
    }
}
